<?php


namespace App\Http\Service\api;


class BankAudit
{
    /**
     * @param $accountNo
     * @param $bankPreMobile
     * @param $idCardCode
     * @param $name
     * 银行卡审核
     */
    public static  function  bank($bankCode,$phone,$cardId,$name){
        $host = "https://lundroid.market.alicloudapi.com";
        $path = "/lianzhuo/verifi";
        $method = "GET";
        $appcode = "15807cb5845e4c99bd258196303a2bc4";
        $headers = array();
        array_push($headers, "Authorization:APPCODE " . $appcode);
        $querys = "acct_name=$name&acct_pan=$bankCode&cert_id=$cardId&phone_num=$phone";
        $bodys = "";
        $url = $host . $path . "?" . $querys;

        $curl = curl_init();
        curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($curl, CURLOPT_FAILONERROR, false);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_HEADER, true);
        if (1 == strpos("$".$host, "https://"))
        {
            curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
            curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
        }
        $data = curl_exec($curl);
        $start = strpos($data,'{');
        $end = strrpos($data,'}');
        $res = json_decode(substr($data,$start,$end),true);
        return $res;
    }
}
